﻿Public Class MenuAdapter
    Inherits FormAdapter(Of frmMenu, MenuListener)

    Private WithEvents btnZeitrapport As Button = form.btnZeitrapport
    Private WithEvents btnKundenauswertung As Button = form.btnKundenauswertung
    Private WithEvents btnStammdatenverwaltung As Button = form.btnStammdatenverwaltung

    Private WithEvents tmrRefreshData As Timer = form.tmrRefreshData

    Sub New()
        MyBase.New(New frmMenu)
        tmrRefreshData.Interval = Val(PropertiesHandler.getValue("db.refreshtime"))
        tmrRefreshData.Start()
    End Sub

    Sub zeitrapport_click() Handles btnZeitrapport.Click
        For Each listener As MenuListener In getObservable().getListeners
            listener.zeitrapportPerformed()
        Next
    End Sub

    Sub kundenauswertung_click() Handles btnKundenauswertung.Click
        For Each listener As MenuListener In getObservable().getListeners
            listener.kundenAuswertungPerformed()
        Next
    End Sub

    Sub stammdaten_click() Handles btnStammdatenverwaltung.Click
        For Each listener As MenuListener In getObservable().getListeners
            listener.stammdatenverwaltungPerformed()
        Next
    End Sub

    Sub timer_tick() Handles tmrRefreshData.Tick
        Context.KUNDE_PROJEKT_TASK_SERVICE.initData()
    End Sub
End Class
